﻿using System;

namespace Ooaavee.TestTools
{
    /// <summary>
    /// Used to identify test hooks that will be run before the test method.
    /// </summary>
    /// <remarks>
    /// This attribute can be specified on a class or on a method.
    /// 
    /// If this attribute is specified on a class, the meaning of it will be automatically applied to every test method in that 
    /// same test class, unless a test method is marked with the <see cref="IgnoreInheritedTestHooksAttribute"/>.
    /// </remarks>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
    public sealed class RunBeforeTestAttribute : TestHookDefinitionAttribute
    {
        /// <summary>
        /// Initializes a new instance of the RunBeforeTestAttribute class.
        /// </summary>
        /// <param name="interfaceType">test hook interface type</param>
        /// <param name="parameters">test hook parameters</param>
        public RunBeforeTestAttribute(Type interfaceType, params object[] parameters)
            : base(interfaceType, parameters)
        {
        }

        /// <summary>
        /// Test hook category.
        /// </summary>
        public override TestHookCategory Category { get { return TestHookCategory.RunBeforeTest; } }
    }
}